import * as React from 'react';
import { runApp, IAppConfig } from 'ice';
import LocaleProvider from '@/components/LocaleProvider';
import { getLocale } from '@/utils/locale';
import * as INIT_DATA from './initData';

const locale = getLocale();

const initData = () =>{

  const isInited = localStorage.getItem('initData');
  if(!isInited){
    localStorage.setItem('initData',JSON.stringify(INIT_DATA));
  }


}

initData();





const appConfig: IAppConfig = {
  app: {
    rootId: 'ice-container',
    addProvider: ({ children }) => (
      <LocaleProvider locale={locale}>{children}</LocaleProvider>
    ),
  },
};
runApp(appConfig);
